package com.flatshare.project;

import android.app.Activity;
import android.content.Intent;
//import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ExpandableListView;
import android.widget.TextView;

public class Home extends Activity implements View.OnClickListener{

	TextView tvTop;
	Button bAdd;
	Button bRefresh;
	Button bLogIn;
	ExpandableListView elvInfo;
	
	protected void onCreate(Bundle HomeScreen) {
		
		super.onCreate(HomeScreen);
		setContentView(R.layout.main);
		
		setVariables();
		setOnClickListeners();
		

	}


	private void setOnClickListeners() {
		// TODO Auto-generated method stub
		bLogIn.setOnClickListener(this);
		tvTop.setOnClickListener(this);
		bAdd.setOnClickListener(this);
		bRefresh.setOnClickListener(this);
	}


	private void setVariables() {
		
		bLogIn = (Button) findViewById(R.id.bLogIn);
		tvTop = (TextView) findViewById(R.id.tvTop);
		bRefresh = (Button) findViewById(R.id.bRefresh);
		elvInfo = (ExpandableListView) findViewById(R.id.elvInfo);
		bAdd = (Button) findViewById(R.id.bAdd);
	}
	
	public void onClick(View v) {
		
		switch (v.getId()) {
		case R.id.bLogIn:
			Intent openHome = new Intent("com.test.clinton.LOGIN");
			startActivity(openHome);
			break;
		case R.id.tvTop:
			Intent openWebSite = new Intent("com.test.clinton.WEBSITE");
			startActivity(openWebSite);
			break;
		case R.id.bAdd:
			Intent openAdd = new Intent("com.test.clinton.ADDNEW");
			startActivity(openAdd);
			break;
		case R.id.bRefresh:
			//Refresh List
			break;
		}
	}
}
